package day_2022_12_to_3.year2023;

/**
 * @author haomin
 * @date 2023/04/06 22:57
 **/
public class Day4_6_Num1017 {
    class Solution {
        public String baseNeg2(int n) {
            if(n==0){return "0";}
            String ans="";
            for(int i=0;n>0;i++){
                ans=(n&1)+ans;
                if((i&1)==1){n+=(n&1)<<1;}
                n>>=1;
            }
            return ans;
        }
    }
}